package com.sinosoft.controller;

import com.sinosoft.pojo.Carousel;
import com.sinosoft.repository.CarouselRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author hyy85
 * @version 1.0
 * @date: 14/6/2018 下午 4:00<br/>
 * @description 轮播图数据接口
 * @since 1.8
 */
@RestController
public class CarouselController {

    private final CarouselRepository carouselRepository;

    @Autowired
    public CarouselController(CarouselRepository carouselRepository) {
        this.carouselRepository = carouselRepository;
    }

    @GetMapping(value = "getCarousels")
    public List<Carousel> getCarouselData() {
        return carouselRepository.findAll();
    }

}
